//
//  Person.m
//  05_Work
//
//  Created by dllo on 16/7/8.
//  Copyright © 2016年 yh. All rights reserved.
//

#import "Person.h"

@implementation Person
- (instancetype)initWithName:(NSString *)name age:(NSInteger)age{
    self = [super init];
    if (self) {
        _name = name;
        _age = age;
    }
    return self;
}

- (NSString *)description{
    return [NSString stringWithFormat:@"%@ %ld", _name, _age];
}

- (NSComparisonResult)compareName:(Person *)per {
    return [self.name compare:per.name];
}


- (NSComparisonResult)compareAge:(Person *)per {
    return self.age > per.age;
}


@end
